{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
	{include file="public/script" /}
</head>
<body>
	<div class="sectionH sectionH2  mui-clearfix">
		<header class="mui-bar mui-bar-nav" style="">
			<!--<a class="mui-icon mui-icon-left-nav  mui-pull-left" href="javascript:history.back(-1)" style="color: #727272;"></a>-->
			<h1 class="mui-title">链资源</h1>
			<!--<a class="mui-icon mui-pull-right right1" href="assets-1.html"><img src="images/icon_setting.png"/></a>-->
		</header>
	</div>
	<div class="kong1"></div>
	<div class="wealth_section1" style="padding-top:0;">
		<div class="tiy mui-clearfix" style="position: fixed;z-index: 999;background: #fff;padding-top: 10px;">
			<ul>
				<li><div><a href="{:url('Resource/resourceList')}"><img src="__STATIC__/www/images/Lian_activity_def.png" alt="" /></a></div></li>
				<li><div><a href="{:url('Resource/unionList')}"><img src="__STATIC__/www/images/Lian_com_select.png" alt="" /></a></div></li>
			</ul>
		</div>
		<div class="kong1" style="height: 100px;"></div>
		<div class="index_section4_2 select" style="position: fixed;width: 100%;z-index: 999;background: #fff;">
			<div class="index_section4_2_3 mui-clearfix">
					<ul>
						{volist name="category" id="c"}
						<a href="{:url('Resource/unionList',array('category_id'=>$c.id))}">
							<li>
								<img src="{$c.thumb}" alt="" />
								<p class="p1 {if condition='$category_id == $c.id'}select{/if}">{$c.title}</p>
							</li>
						</a>

						{/volist}

					</ul>
			</div>
			<div class="ge"></div>
		</div>
		<div class="kong1" style="height: 120px;"></div>
		<div class="index_section4_2 select" style="padding-top: 0px">
			<div class="index_section4_2_4" id="items" style="position: absolute;z-index: 2;width: 100%;height: 54%;">
				<div class="index_section5_2 select" style="position: absolute;width: 100%;z-index: 1;">
					<div class="container" style="position: relative;">
						{volist name="list" id="l"}
							<div class="index_section5_2_1 mui-clearfix">
								<a href="{:url('Resource/unionInfo',array('id'=>$l.id))}">
									<div class="index_section5_2_1-1">
										<img src="{$l.thumb}"/>
									</div>
								</a>
									<div class="index_section5_2_1-2">
										<p class="p1">{$l.title}</p>
										<a href="tel:{$l.tel}"><p class="p2">电话：{$l.tel} <img src="__STATIC__/www/images/icon_tel.png" alt="" /></p></a>
										<p class="p3">地址：{$l.address}</p>
										<a href="javascript:dao('{$l.latitude}','{$l.longitude}');" data-lat="" data-lng=""><img src="__STATIC__/www/images/icon_location.png" alt="" class="daodao" onclick="android.intentToMap({$l.longitude},{$l.latitude})"/></a>
									</div>

							</div>


						{/volist}
					</div>
				</div>

			</div>
		</div>
		
	</div>

{include file="public/footer" /}
</body>
<script>
    mui.init({
        pullRefresh: {
            container: '#items',
            down: {

            },
            up: {
                auto:false,
                contentrefresh: '正在加载...',
                callback: pullupRefresh
            }
        }
    });
    var count = {$page};
    var cid = "{$category_id}";
    function pullupRefresh() {
        setTimeout(function() {
            // mui('#items').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
            var table = document.body.querySelector('.container');
            var url="{:url('Resource/unionList')}";
            count++;
            $.post(url,{page:count,page_size:5,category_id:cid},function(data){
                var data=JSON.parse(data);
                if(data==0)
                {
                    mui('#items').pullRefresh().endPullupToRefresh((data==0));
                }else{
                    for (var i = 0; i < data.length; i++) {
                        var li = document.createElement('div');
                        var url1="/Resource/unionInfo/id/"+data[i]['id'];
                        li.className = 'index_section5_2_1 mui-clearfix';
                        li.innerHTML = '<a href="'+url1+'"><div class="index_section5_2_1-1">\n' +
                            '<img src="'+data[i]["thumb"]+'"/>\n' +
                            '</div></a>\n' +
                            '<div class="index_section5_2_1-2">\n' +
                            '<p class="p1">'+data[i]["title"]+'</p>\n' +
                            '<p class="p2">电话：'+data[i]["tel"]+' <img src="__STATIC__/www/images/icon_tel.png" alt="" /></p>\n' +
                            '<p class="p3">地址：'+data[i]["address"]+'</p>\n' +
                            '<a href="javascript:dao('+data[i]['latitude']+','+data[i]['longitude']+');"><img src="__STATIC__/www/images/icon_location.png" alt="" class="daodao"/></a>\n' +
                            '</div>';
                        table.appendChild(li);

                    }

                }
                mui('#items').pullRefresh().endPullupToRefresh((data==0));
            })

        }, 1000);
    }
    function dao(lat,lng) {
		var is_app = "<?php echo @$_GET['is_app'] ?>";
		if(is_app == 1){
			if(lat!=''&&lng!=''){
                android.intentToBaiduMap(lat,lng);
            }
		}
    }
</script>


</html>